package com.tonghe.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Date:2022/2/18- 02- 18- 13:58
 **/
@Configuration
public class MybatisPlusConfig {
    /**
     * 3.4.0之后版本
     * @return
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor(); // 拦截器
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor()); // 分页拦截器
        return mybatisPlusInterceptor;
    }
}
